package com.kexio.enterprise.observability.logging.domain;

import com.kexio.enterprise.observability.logging.annotation.OperateLog;

import java.time.LocalDateTime;

/**
 * 操作日志条目
 * 
 * @author Kexio
 * @since 1.0.0
 */
public class OperateLogEntry {
    private Long id;
    private String module;
    private String operation;
    private String detail;
    private OperateLog.OperationType type;
    private OperateLog.LogLevel level;
    private String businessKey;
    private String[] tags;
    private Long userId;
    private String username;
    private String userRealName;
    private Long tenantId;
    private String tenantName;
    private String requestUrl;
    private String requestMethod;
    private String requestParams;
    private String responseResult;
    private String exceptionMessage;
    private String userAgent;
    private String requestIp;
    private LocalDateTime createTime;
    private Long executionTime;
    private Boolean success;
    private String traceId;
    private String spanId;

    public OperateLogEntry() {
        this.createTime = LocalDateTime.now();
        this.success = true;
    }

    // Getters and Setters
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }
    
    public String getModule() { return module; }
    public void setModule(String module) { this.module = module; }
    
    public String getOperation() { return operation; }
    public void setOperation(String operation) { this.operation = operation; }
    
    public String getDetail() { return detail; }
    public void setDetail(String detail) { this.detail = detail; }
    
    public OperateLog.OperationType getType() { return type; }
    public void setType(OperateLog.OperationType type) { this.type = type; }
    
    public OperateLog.LogLevel getLevel() { return level; }
    public void setLevel(OperateLog.LogLevel level) { this.level = level; }
    
    public String getBusinessKey() { return businessKey; }
    public void setBusinessKey(String businessKey) { this.businessKey = businessKey; }
    
    public String[] getTags() { return tags; }
    public void setTags(String[] tags) { this.tags = tags; }
    
    public Long getUserId() { return userId; }
    public void setUserId(Long userId) { this.userId = userId; }
    
    public String getUsername() { return username; }
    public void setUsername(String username) { this.username = username; }
    
    public String getUserRealName() { return userRealName; }
    public void setUserRealName(String userRealName) { this.userRealName = userRealName; }
    
    public Long getTenantId() { return tenantId; }
    public void setTenantId(Long tenantId) { this.tenantId = tenantId; }
    
    public String getTenantName() { return tenantName; }
    public void setTenantName(String tenantName) { this.tenantName = tenantName; }
    
    public String getRequestUrl() { return requestUrl; }
    public void setRequestUrl(String requestUrl) { this.requestUrl = requestUrl; }
    
    public String getRequestMethod() { return requestMethod; }
    public void setRequestMethod(String requestMethod) { this.requestMethod = requestMethod; }
    
    public String getRequestParams() { return requestParams; }
    public void setRequestParams(String requestParams) { this.requestParams = requestParams; }
    
    public String getResponseResult() { return responseResult; }
    public void setResponseResult(String responseResult) { this.responseResult = responseResult; }
    
    public String getExceptionMessage() { return exceptionMessage; }
    public void setExceptionMessage(String exceptionMessage) { this.exceptionMessage = exceptionMessage; }
    
    public String getUserAgent() { return userAgent; }
    public void setUserAgent(String userAgent) { this.userAgent = userAgent; }
    
    public String getRequestIp() { return requestIp; }
    public void setRequestIp(String requestIp) { this.requestIp = requestIp; }
    
    public LocalDateTime getCreateTime() { return createTime; }
    public void setCreateTime(LocalDateTime createTime) { this.createTime = createTime; }
    
    public Long getExecutionTime() { return executionTime; }
    public void setExecutionTime(Long executionTime) { this.executionTime = executionTime; }
    
    public Boolean getSuccess() { return success; }
    public void setSuccess(Boolean success) { this.success = success; }
    
    public String getTraceId() { return traceId; }
    public void setTraceId(String traceId) { this.traceId = traceId; }
    
    public String getSpanId() { return spanId; }
    public void setSpanId(String spanId) { this.spanId = spanId; }
}
